package calculate24.play.SelfCalculate.CardsHistory;

import android.graphics.drawable.Drawable;

import calculate24.play.common.card.Card;

class CardRecord {
    int number;
    Drawable image;
    String text;
    int visibility;
    boolean picked;

    public void setStatusFrom(Card card) {
        number = card.number;
        image = card.view.getDrawable();
        text = card.view.getDrawText();
        visibility = card.view.getVisibility();
        picked = card.isPicked();
    }

    public void getStatusInto(Card card) {
        card.number = number;
        card.view.setImageDrawable(image);
        card.view.setDrawText(text);
        card.view.setVisibility(visibility);
        if(card.isPicked() && !picked) {
            card.drop();
        } else if(!card.isPicked() && picked) {
            card.pick();
        }
    }
}
